package com.congee02.modelshellmvn.utils;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.reflect.MethodSignature;

import java.lang.annotation.Annotation;

public final class AnnotationUtils {

    private AnnotationUtils() {}

    public static <T extends Annotation> T extractAnnotationFromJoinPoint(JoinPoint joinPoint, Class<T> type) {
        return ((MethodSignature) joinPoint.getSignature()).getMethod().getAnnotation(type);
    }

}
